import service from "../utils/request";

/** 添加分类*/
export function AddFirstCategory(data) {
  return service.request({
    method: "post",
    url: "/article/addFirstCategory/",
    data
  });
}

/** 获取分类*/
export function GetCategory(data) {
  return service.request({
    method: "post",
    url: "/article/getCategory/",
    data
  });
}

/** 删除分类*/
export function DeleteCategory(data){
  return service.request({
    method: "post",
    url: "/news/deleteCategory",
    data
  });
}

/** 修改分类*/
export function EditCategory(data){
  return service.request({
    method: "post",
    url: "/news/editCategory",
    data
  });
}

/** 新增文章*/
export function addArticle(data){
  return service.request({
    method: "post",
    url: "/article",
    data
  });
}

/** 获取文章列表*/
export function getArticleList(data){
  return service.request({
    method: "post",
    url: "/article/list",
    data
  });
}

/** 删除文章*/
export function deleteArticle(data){
  return service.request({
    method: "delete",
    url: "/article",
    data
  });
}

/** 修改文章*/
export function editArticle(data){
  return service.request({
    method: "update",
    url: "/article",
    data
  });
}

/** 获取七牛云token*/
export function getQiniuToken() {
  return service.request({
    method: "post",
    url: ""
  })
}
